﻿Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
Imports BBDD

 _

Class historico
   Inherits System.Web.UI.Page

   Protected Sub Page_Load(sender As Object, e As EventArgs)
      If Session("privUser") Is Nothing Or Integer.Parse(Session("privUser").ToString()) < 1 Then
         Response.Redirect("index.aspx")
      End If
      If Session("privUser") Is Nothing Or Integer.Parse(Session("privUser").ToString()) = 1 Then
         Me.campoDNI.Text = Session("DNIUser").ToString()
         Me.campoDNI.Enabled = False
         Me.BotonAceptar.Enabled = False
            listaHistorico.Value = "Lista de compras:" + vbCrLf + Consultas.listarCompras(0, Session("DNIUser").ToString(), 1) + vbCrLf + "Lista de ventas:" + vbCrLf + " " + Consultas.listarVenta(0, Session("DNIUser").ToString())
      End If
   End Sub 'Page_Load
    
   
   Protected Sub aceptarDNI(sender As Object, e As EventArgs)
        listaHistorico.Value = "Lista de compras:" + vbCrLf + vbCrLf + " " + Consultas.listarCompras(0, Me.campoDNI.Text.ToString(), 1) + vbCrLf + vbCrLf + "Lista de ventas:" + vbCrLf + vbCrLf + " " + Consultas.listarVenta(0, Me.campoDNI.Text.ToString())
   End Sub 'aceptarDNI
End Class 'historico